home *** CD-ROM | disk | FTP | other *** search
- Path: news.internetMCI.com!news-admin
- From: john b <jointprd@crl.com>
- Newsgroups: comp.lang.c,comp.unix.questions
- Subject: Help - Fork, exec
- Date: Tue, 06 Feb 1996 09:43:22 -0800
- Organization: G&R
- Message-ID: <3117933A.4E44@crl.com>
- NNTP-Posting-Host: 166.42.154.21
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6b (Win16; I)
-
- Ok - first things first I'm a DBA by trade and a C coder by necessity.
- My C skills are OK at best, so bear with me if I ask "newbie-like"
- questions.
-
- Here's the issue - I have some code (specifically Open Server for Sybase)
- that basically acts as a forwarding mechanism for Powerbuilder. In other
- words, Powerbuilder calls my SQL Server, the SQL Server calls the Open
- Server, and ultimately the Open Server calls a UNIX parameterized (sp?)
- script. (This is the architecture and will not change.) All works great
- for a single user, but if I throw in a second user things gets screwed
- up. Basically, if the first user has not finished his "task" the second
- one clobbers him. My real world example consists of two users executing
- an FTP. One is not finished, the other cranks up and wham - the first is
- killed.
-
- So... here's the $100,000 question. How can I make my code reentrant?
- I'm toying with the idea of using fork and exec, but I've no clue how to
- really use them. Does anyone have a working example of how this works?
- I've posted my original question in the comp.databases.sybase group, but
- most of the folks are more of a SQL type. If you want to see an snippet
- of the code the post is under Open Server - Help Mutex by john b (in
- comp.databases.sybase). If you want me to post the question
- here let me know too. Basically I'm executing a system() call.
-
- If I've placed the question in the wrong forum, my apologies.
-
- Any help would be appreciated.
-
- JB
-